package com.springStudy.core.profile.envconfig;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.context.annotation.PropertySource;

@Configuration
@Profile("prod")
@PropertySource(value={"classpath*:prod/*.properties"})
public class ConfigProd {
    @Value("${database.name}")
    private String dbName ;
    @Bean
    public String DBConfig() {
        String db = "一个生产环境数据库对象"+dbName;
        System.out.println(db);
        return db;

    }
}
